package com.security.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.websocket.server.PathParam;

/**
 * @author ZhangJunqi
 * @Date 2022/3/4 -20:09
 */
@Controller
public class RedirectionController {

    @RequestMapping({"/","/index"})
    public String toIndex(){
        return "/index";
    }

    @RequestMapping("/toLogin")
    public String toLogin(){
        return "/views/login";
    }

    @RequestMapping("level1/{id}")
    public String toLevel1(@PathVariable("id")Integer id){
        return "/views/level1/"+id;
    }

    @RequestMapping("level2/{id}")
    public String toLevel2(@PathVariable("id")Integer id){
        return "/views/level2/"+id;
    }

    @RequestMapping("level3/{id}")
    public String toLevel3(@PathVariable("id")Integer id){
        return "/views/level3/"+id;
    }
}
